
***********************Figure 4**********************************

******************************************
********Open 2020_MTurk_data.dta********
******************************************


***create variable for anger vs. control article condition
tab condition
gen angrcon=condition
recode angrcon (1=1) (2=0)
tab angrcon condition


******Recode anger variables 0 - 1

***Anger at T1
tab anger1
gen angert1=anger1
recode angert1 (1=1) (2=.66) (3=.33) (4=0) 
tab angert1
tab anger1


***Anger at T2
tab anger2
gen angert2=anger2
recode angert2 (1=1) (2=.66) (3=.33) (4=0) 
tab angert2
tab anger2

***create difference in anger variable
gen diffanger=angert1-angert2


*********create conditions variable 0=control/control 1=anger/problem-focused 2=anger/emotion-focused
gen cntrcfrtdis=.
replace cntrcfrtdis=0 if acon==4
replace cntrcfrtdis=1 if condition==1 & acon==1
replace cntrcfrtdis=2 if condition==1 & acon==2
tab cntrcfrtdis


***Create diplomacy extremity variable
gen diplomacy1=.
replace diplomacy1=0 if diplomacy==4
replace diplomacy1=.33 if diplomacy==3
replace diplomacy1=.66 if diplomacy==2
replace diplomacy1=1 if diplomacy==1
replace diplomacy1=.33 if diplomacy==5
replace diplomacy1=.66 if diplomacy==6
replace diplomacy1=1 if diplomacy==7
tab diplomacy 
tab diplomacy1

**********Figure 4****************
reg diplomacy1 i.cntrcfrtdis
margins cntrcfrtdis, level(90)
marginsplot, xlabel(0 `" "Control/" "Control" "'  1 `" "Anger/" "Problem-Focused" "' 2 `" "Anger/" "Emotion-Focused" "' ) recast(scatter) graphregion(color(white))  xtitle("") title("Predicted Values") ytitle("Extremity of Position on Military Force")  xscale(r(-.4 2.4)) name(extremity1, replace)

reg diplomacy1 i.cntrcfrtdis
margins i.cntrcfrtdis
margins r.cntrcfrtdis, level(90)
marginsplot, recast(scatter) yline(0) title("Marginal Effects") plot1opts(mcolor(black)) ci1opts(lcolor(black)) xlab(1 `" "Anger/Problem-Focused" "vs." "Control/Control" "' 2  `" "Anger/Emotion-Focused" "vs." "Control/Control" "') graphregion(color(white))  xtitle("") ytitle("Difference in Extremity of Position on Military Force") xscale(r(.4 2.4)) ylabel(-.1(.05).15) name(extremity2, replace)

graph combine extremity1 extremity2, graphregion(color(white)) xsize(7) iscale(.7)

graph export Figure_4.jpg,  replace height(1000)